package com.learner.exam.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.learner.exam.dao.ExamQuestionRepository;
import com.learner.exam.service.ExamQuestionService;
import com.learner.pojo.exam.ExamQuestion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ice2020x
 * @Date: 2023/3/8
 * @Description: 考试里的题目实体
 **/
@Service
public class ExamQuestionServiceImpl extends ServiceImpl<ExamQuestionRepository, ExamQuestion> implements ExamQuestionService {

    @Autowired
    private ExamQuestionRepository examQuestionDao;

    @Override
    public ExamQuestion getExamQuestionByExamId(Integer examId) {
        QueryWrapper<ExamQuestion> queryWrapper = new QueryWrapper<ExamQuestion>().eq("exam_id", examId);
        return examQuestionDao.selectOne(queryWrapper);
    }
}
